<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script>

//parentName父容器标签名称divName要显示标签的名称

function ShowTagss(parentName, divName)

{

var childObj = document.getElementById(parentName).childNodes;

if (typeof(childObj) != "undefined") {

for(var i = 0; i < childObj.length; i++) {

childObj[i].style.display = "none";

}

}

document.getElementById(divName).style.display="block";

}

</script>
</head>
<body>
<table>

<tr>

<td>

<a href = "javascript:ShowTagss( 'parentDivs', 'div1' )">标题1</a>

<a href = "javascript:ShowTagss( 'parentDivs', 'div2' )">标题2</a>

<a href = "javascript:ShowTagss( 'parentDivs', 'div3' )">标题3</a>

</td>

</tr>

<tr>

<td id='parentDivs'>

<div id='div1'>添加要显示的内容</div>

<div id='div2'>添加要显示的内容</div>

<div id='div3'>添加要显示的内容</div>

</td>

</tr>

</table>
</body>
</html>